//
//  STProjectImgView.m
//  YiYueHairdresser
//
//  Created by zhouzhouzhou on 2018/10/11.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STProjectImgView.h"
#import "SWWokerModel.h"

@implementation STProjectImgView

-(void)setOwnCollectionCellWithData:(id)data{
    if (!image) {
        image = [[UIImageView alloc]initWithFrame:self.bounds];
        [self.contentView addSubview:image];
    }
    
    if([data isKindOfClass:[STHairStylistOpusModel class]]){
        STHairStylistOpusModel * model = data;
        [image sd_setImageWithURL:[NSURL URLWithString:model.stylistOpusCovers] placeholderImage:[UIImage imageNamed:@"h-hairEg"]];
    }else if([data isKindOfClass:[STHairOpusModel class]]){
        STHairOpusModel * model = data;
        [image sd_setImageWithURL:[NSURL URLWithString:model.stylistOpusCovers] placeholderImage:[UIImage imageNamed:@"h-hairEg"]];
    }else if([data isKindOfClass:[SWWokerModel class]]){
        SWWokerModel *model = data;
        [image sd_setImageWithURL:[NSURL URLWithString:model.opusPath] placeholderImage:[UIImage imageNamed:@"h-hairEg"]];
    }else if([data isKindOfClass:[NSString class]]){
        NSString *model = data;
        [image sd_setImageWithURL:[NSURL URLWithString:model] placeholderImage:[UIImage imageNamed:@"h-hairEg"]];
    }
}
@end
